package cn.yangliu.mybatis.config;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 作者 杨柳
 * 创建时间 2017-08-23 01:15
 */
@Configuration
@AutoConfigureAfter(value = {MybatisConfig.class})
public class MapperScanner {
    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer configurer = new MapperScannerConfigurer();
        configurer.setBasePackage("cn.yangliu.mybatis.mapper");
        configurer.setSqlSessionFactoryBeanName("mybatisSqlSessionFactoryBean");
        return configurer;
    }
}
